<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>日期学习</title>

    <script>
        var data = new Date();
        //格式化时间
        console.log(data.getFullYear() + '年' + data.getMonth() + '月' + data.getDate() + '号' + '\t' + data.getHours() + ':' + data.getMinutes() + ':' + data.getSeconds());

        //时间戳
        console.log(data.getTime());
        console.log(data);
    </script>


</head>

<body>

</body>

</html>